/*
 * @FilePath: /nong-chang/vite.base.config.ts
 * 介绍:无论哪个环境都会执行的配置项
 */

import vue from "@vitejs/plugin-vue";
import { defineConfig } from "vite";
import path from "path";
import AutoImport from "unplugin-auto-import/vite";

export default defineConfig({
  base: "/",
  resolve: {
    alias: {
      "@@": path.join(__dirname, "src"),
      "@@router": path.join(__dirname, "src/router/index"),
      "@@defaHttp": path.join(__dirname, "src/utils/defaHttp/index"),
    },
  },

  plugins: [
    vue(),
    AutoImport({
      // 自动导入 Vue 相关函数，如：ref, reactive, toRef 等
      imports: ["vue"],
      dts: "./src/type/auto-import/auto-imports.d.ts",
    }),
  ],
});
